/*
ShowHide visibility of text input and textarea fields
Input fields must have an id=ShowHide & must have a machtchin name field to
the value field on the select box

Author:  Dennis T. Kaplan
*/

var inputfields=new Array();
var textareafields=new Array();
var count;
$(document).ready(function() {
            inputfields = document.getElementsByTagName("input");
            textareafields = document.getElementsByTagName("textarea");
            change()
        }
    );

function change(instyle){
        sh(inputfields,instyle)
        sh(textareafields,instyle)
}
function sh(array, instyle){
    for (var i = 0; i < array.length; i++) {
        var obj = array[i]
        if(obj.id == 'ShowHide' && obj.name != instyle){
                $(obj).hide("normal");
        }
        if(obj.id == 'ShowHide' && obj.name == instyle){
                $(obj).show("normal");
        }
    }
}

